﻿<UserControl x:Class="YLServerInterface.UserControls.TemplateBuilder.TemplateItemShower"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:my="clr-namespace:YLServerInterface.UserControls.TemplateBuilder"
                     xmlns:frm="clr-namespace:YLServerInterface.Forms"

             mc:Ignorable="d" 
             d:DesignHeight="257" d:DesignWidth="305">
    <UserControl.Resources>
        <frm:GetTemplateDetialConvert x:Key="getDetial"/>
    </UserControl.Resources>

    <Grid Margin="3">
        <Grid.RowDefinitions>
            <RowDefinition  Height="auto"/>
            <RowDefinition  Height="*"/>
            <RowDefinition  Height="*"/>
            <RowDefinition  Height="auto"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0" Margin="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
            </Grid.RowDefinitions>
            <TextBlock
                    Grid.Row="0"
                    Grid.Column="0">模板名称：</TextBlock>
            <TextBox 
                    Grid.Row="0"
                    Grid.Column="1"
                     Name="txtTemplateName" 
                         ></TextBox>
            <TextBlock 
                    Grid.Row="1"
                    Grid.Column="0">是否启用：</TextBlock>
            <CheckBox
                    Grid.Row="1"
                    Grid.Column="1"
                    Name="ckbTemplateIsEnable"></CheckBox>
            <TextBlock
                    Grid.Row="2"
                    Grid.Column="0"
                >定价：</TextBlock>
            <TextBox
                    Grid.Row="2"
                    Grid.Column="1"
                    Name="txtTemplatePrice"></TextBox>
            <TextBlock Grid.Row="3">制作材料在FTP上目录:</TextBlock>
            <TextBox   Grid.Row="3" Grid.Column="1"
                Name="txtAttachmentDir"></TextBox>
                <TextBlock Grid.Row="4" ToolTip="现在是雅致的项目文件(yazhi.fpp)、exe图标文件(*.ico)以及打包需要的swf文件"> 上传制作材料:
            </TextBlock>
            <Button Grid.Row="4" Grid.Column="1"
                    Name="btnFilesUpload" Click="btnFilesUpload_Click">
                上传
            </Button>
        </Grid>

        <Grid Grid.Row="1"  Margin="3" >
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Button Grid.Row="0"
                        Name="btnAddRequireValue" Click="btnAddRequireValue_Click">添加填写的参数</Button>
            <ListBox
                    Grid.Row="1"
                   Name="lstRequireValues"
                  ItemsSource="{Binding}"
                >
                <ListBox.ContextMenu>
                    <ContextMenu >
                        <MenuItem Header="删除" Name="RequireValueMenuItemDelete" Click="requireValueMenuItemDelete_Click" />
                    </ContextMenu>
                </ListBox.ContextMenu>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <my:RequireValueItem DataContext="{Binding}"/>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
        <Grid Grid.Row="2"  Margin="3">
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Button Grid.Row="0"
                        Name="btnAddAttachment" Click="btnAddAttachment_Click">添加要上传附件的参数</Button>
            <ListBox 
                    Grid.Row="1"
                    Name="lstRequireAttachments"   ItemsSource="{Binding  }" >
                <ListBox.ContextMenu>
                    <ContextMenu >
                        <MenuItem Header="删除" Name="attachMentMenuItemDelete" Click="attachMenuItemDelete_Click" />
                    </ContextMenu>
                </ListBox.ContextMenu>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <my:RequireValueItem DataContext="{Binding}"/>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
        <Button Grid.Row="3"  Margin="3"
                Name="btnUploadInfo" Click="btnUploadInfo_Click">
            完成修改或添加
        </Button>

    </Grid>

</UserControl>
